package Creational_design_pattern.Singleton.Lazy_Singleton;

public class LazySingleton {
    // 私有静态成员变量
    private static LazySingleton instance = null;
    //私有构造
    private LazySingleton(){};
    //公有静态工厂方法
    synchronized public static LazySingleton getInstance(){
        if(instance == null){
            instance = new LazySingleton();
        }
        return instance;
    }
}
